#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
/*********Begin*********/
int max(int a, int b) {
    return(a > b) ? a : b;
}

/*********End**********/
int main(void)
{
    int n, s[110];
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%d", &s[i]);
    int ans;
    /*********Begin*********/
    int (*p)(int x, int y);
    p = max;
    ans = s[0];
    for (int i = 1; i < n; i++) {
        ans = p(ans, s[i]);
    }

    /*********End**********/
    printf("%d", ans);
    return 0;
}